import * as ajaxRequest from "../ajaxRequest";

import environment from "@/environment/index";

/**
 * 获取数据管理
 * @param {*} option 
 */
// 数据列表
export const getList = options => {
    return ajaxRequest.get(`${environment.productApi}/api/v1/Product/GetList`, options);
};

// 详情
export const getDetail = options => {
    return ajaxRequest.get(`${environment.productApi}/api/v1/Product/getdetail/${options}`);
};
// 新增
export const postCreate = options => {
    return ajaxRequest.post(`${environment.productApi}/api/v1/Product/Create`, options);
};
// 编辑
export const putEdit = options => {
    return ajaxRequest.put(`${environment.productApi}/api/v1/Product/Edit`, options);
};
// 下架
export const putOfflone = options => {
    return ajaxRequest.put(`${environment.productApi}/api/v1/Product/offline/${options}`);
};
// 上架
export const putOnline = options => {
    return ajaxRequest.put(`${environment.productApi}/api/v1/Product/online/${options}`);
};

// 属性列表
export const getProductAttributeList = options => {
    return ajaxRequest.get(`${environment.productApi}/api/v1/ProductAttribute/GetList`, options);
};
/**
 * 获取分类管理
 * @param {*} option 
 */
// 分类列表
export const getProductCategoryList = options => {
    return ajaxRequest.get(`${environment.productApi}/api/v1/ProductCategory/GetList`, options);
};
// 分类详情
export const getProductCategoryByid = options => {
    return ajaxRequest.get(`${environment.productApi}/api/v1/ProductCategory/getbyid/${options}`);
};
// 分类新增
export const ProductCategoryCreate = options => {
    return ajaxRequest.post(`${environment.productApi}/api/v1/ProductCategory/Create`, options);
};
// 分类编辑
export const ProductCategoryEdit = options => {
    return ajaxRequest.put(`${environment.productApi}/api/v1/ProductCategory/Edit`, options);
};
// 分类删除
export const ProductCategorydelete = options => {
    return ajaxRequest._delete(`${environment.productApi}/api/v1/ProductCategory/delete/${options}`);
};